"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var knex = require("knex");
var Query_1 = require("./sql/Query");
var Insert_1 = require("./sql/Insert");
var Truncate_1 = require("./sql/Truncate");
var Update_1 = require("./sql/Update");
var Delete_1 = require("./sql/Delete");
var MyCrypto_1 = require("../MyCrypto");
var DBConnection = /** @class */ (function () {
    function DBConnection(props) {
        this._crypto = new MyCrypto_1.default();
        var DBConfig = props.DBConfig;
        this._knex = knex({ client: 'mysql', connection: DBConfig });
        this._Query = new Query_1.default({ knex: this._knex });
        this._Insert = new Insert_1.default({ knex: this._knex });
        this._Truncate = new Truncate_1.default({ knex: this._knex });
        this._Update = new Update_1.default({ knex: this._knex });
        this._Delete = new Delete_1.default({ knex: this._knex });
    }
    ;
    Object.defineProperty(DBConnection.prototype, "knex", {
        get: function () {
            return this._knex;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DBConnection.prototype, "Query", {
        get: function () {
            return this._Query;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DBConnection.prototype, "Insert", {
        get: function () {
            return this._Insert;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DBConnection.prototype, "Truncate", {
        get: function () {
            return this._Truncate;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DBConnection.prototype, "Update", {
        get: function () {
            return this._Update;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DBConnection.prototype, "Delete", {
        get: function () {
            return this._Delete;
        },
        enumerable: true,
        configurable: true
    });
    DBConnection.prototype.encode = function (DATA) {
        return this._crypto.dataEncode(DATA);
    };
    DBConnection.prototype.strEncode = function (DATA) {
        return this._crypto.strEncode(DATA);
    };
    DBConnection.prototype.strDecode = function (DATA) {
        return this._crypto.strDecode(DATA);
    };
    return DBConnection;
}());
exports.default = DBConnection;
